# This is a sample api auto test scripts.
import logging
import unittest

from htmltestreport import HTMLTestReport

from config import BASE_DIR
from scripts.ihrm_emp_add_test import TestEmpAdd
from scripts.ihrm_login_test import TestLogin
from uilts.logging_code import init_log_config

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.


# Press the green button in the gutter to run the scripts.
if __name__ == '__main__':
    init_log_config(BASE_DIR + "/log/ihrm.log")

    suite = unittest.TestSuite()
    logging.info("生成测试套件实例")

    loader = unittest.TestLoader()
    suite.addTest(loader.loadTestsFromTestCase(TestLogin))
    suite.addTest(loader.loadTestsFromTestCase(TestEmpAdd))
    runner = HTMLTestReport("report/ihrm.html", title="登录/添加员工接口自动化测试", description="测试用例18条")
    runner.run(suite)

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
